<?php
namespace app\miniapp\model;

use think\Model;

class GoodsModel extends Model
{
    protected $name = 'goods';

    // 拼接商品封面图域名
    public function getImageAttr($value)
    {
        return config('site.web_url').$value;
    }

    // 关联多图
    public function images()
    {
        return $this->hasMany('GoodsAttachModel', 'goods_id', 'id');
    }
}